-
Notifications
You must be signed in to change notification settings - Fork 49
refactor: Shared to use internal mutability #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
refactor: Shared to use internal mutability #197
Conversation
elenaf9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR @akaladarshi!
Some comments.
aabc8a2 to
f7ad5e9
Compare
|
@elenaf9 Thanks for the review 🙏. I have removed the |
elenaf9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, rest LGTM. Thank you for the follow-ups @akaladarshi!
cc @jxs: think this change is an improvement because it hides the mutex-locking logic behind the Shared type and prevents deadlocks that would otherwise been possible when trying to locking the Mutex re-entrantly. Are you okay with merging?
Fixes: #170
This PR changes:
Sharedstruct internally handles the mutex.Sharedstruct now hasinner: Arc<Mutex<SharedInner>>